<template>
  <!-- 供应商分子公司汇总新增 -->
  <div class="e-form">
    <div class="tabs">
      <div class="tabs-title">基本信息</div>
       <div style="width: 100%" class="form">
                  <el-form :model="formData" label-width="150px">
                <BillTop title="供应商分子公司汇总新增" @cancel="handleClose"></BillTop>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="汇总日期">
                          <el-date-picker
                            style="width: 300px"
                            v-model="formData.collectDate"
                            type="date"
                            placeholder="选择日期"
                            :clearable="false"
                          >
                          </el-date-picker>
                        </el-form-item>
                      </el-col>

                      <el-col :span="12">
                        <el-form-item label="汇总时间区间：">
                          {{ formData.summartDate }}
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row>
                      <el-col :span="12">
                        <el-form-item label="评价机构"
                          >{{ formData.evaluateOrg }}
                        </el-form-item>
                      </el-col>
                      <el-col :span="12">
                        <el-form-item label="状态">
                          {{ formData.state }}
                        </el-form-item>
                      </el-col>
                    </el-row>

                     <el-row>
                        <el-col :span="24">
                    <el-form-item label="备注"
                      ><el-input
                        type="textarea"
                        :rows="2"
                        placeholder="请输入内容"
                        v-model="formData.remark"
                      >
                      </el-input
                    ></el-form-item>
                      </el-col>
                    </el-row>
                     <el-row>
                         <el-col :span="12">
                      <el-form-item label="经办人"
                        >{{ formData.man }}
                      </el-form-item>
                       </el-col>
                        <el-col :span="12">
                      <el-form-item label="录入时间"
                        >{{ formData.dates }}
                      </el-form-item>
                       </el-col>
                    </el-row>
                  </el-form>
                </div>
    </div>
    <div class="buttons">
       <el-button type="primary" style="background: #2e61d7" @click="save()"
        >保存</el-button
      >
      <el-button type="primary" style="background: #2e61d7" @click="submit()"
        >保存并提交</el-button
      >
      <el-button @click="cancel()">取消</el-button>
    </div>
  </div>
</template>

<script>
export default {
    data () {
        return {
            //表单数据
            formData: {
                collectDate: '', //汇总日期
                summartDate: '', //汇总时间区
                evaluateOrg: '', //评价机构
                state: '草稿', //状态
                remark: '', //备注
                man: '',    //经办人
                dates: '', //录入时间
            },

            orgId: '', //机构id
            orgName: '', //机构名称
        }
    },
    computed: {},
    components: {},
    created () {
        let data = JSON.parse(localStorage.getItem('vuex'))
        this.orgId = data.userInfo.orgInfo.orgId
        this.orgName = data.userInfo.orgInfo.orgName

    },
    mounted () {},
    beforeDestroy () {},
    methods: {
        //保存按钮
        save () {

            // //日期转换格式
            // let collectDate = this.getTime(this.formData.collectDate)
            // this.$Ajax
            //     .httpPost({
            //         url: '/outer/summary/create',
            //         params: {
            //             billDate: collectDate, //	单据时间
            //             billNo: '', //	评价编号
            //             closeDate: '', //	截止评价日期
            //             evaluateYear: '', //	评价年度
            //             gmtCreate: '', //	录入时间
            //             gmtModified: '', //最后修改时间
            //             groupDtlList: [], //集团汇总明细
            //             id: '', //评价ID
            //             isGroup: 0, //	是否是集团汇总(是集团传1 是分子公司传0)
            //             orgId: this.orgId, //	创建机构ID
            //             orgName: this.orgName, //	机构名称
            //             releasestate: 0, //	发布状态0未发布1发布
            //             remark: '', //	备注
            //             state: 0, //状态
            //             subDtlList: [], //分子公司汇总明细
            //             summartDate: '2008-01-01——2022-01-01', //	汇总时间区间
            //             workId: '',	//作业ID

            //         }
            //     })
            //     .then(res => {
            //         this.$message({
            //             message: res.message,
            //             type: 'success'
            //         })
            //         this.$router.push('/collectEvaluate')
            //     })
        },
        //提交按钮
        submit () {

        },

        //取消按钮
        cancel () {
            this.$router.push('/supplierCollectEvaluate')
        },
        //日期转换格式
        getTime (dt) {
            var year = dt.getFullYear() //年
            var month = dt.getMonth() + 1 //月
            var date = dt.getDate() //日
            month = month < 10 ? '0' + month : month
            date  = date < 10 ? '0' + date : date
            var str = year + '-' + month + '-' + date
            return str
        },
    },
}
</script>

<style lang="scss" scoped>
.buttons {
  left: 0;
}
.e-form {
  margin-bottom: 80px;
  padding: 0 20px;
  .tabs-title::before {
    content: "";
    height: 22px;
    width: 8px;
    border-radius: 40px;
    background-color: #2e61d7;
    display: block;
    position: absolute;
    left: 20px;
    margin-right: 20px;
  }
}

.form {
}

.e-table {
  background: #fff;
}

.el-tab-pane {
  margin-left: -10px;
}
</style>
